package com.example.elasticScrollView;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.ViewGroup;
import android.widget.ImageView;

public class ElasticScrollViewActivity extends ActionBarActivity {

    public static final String TAG = "ElasticScrollView";

    private ImageView view0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_elastic_scroll_view);

        ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scrollView);
        getWindow().getDecorView().setBackgroundColor(Color.DKGRAY);

        view0 = (ImageView) findViewById(R.id.image0);
        ViewGroup.LayoutParams params = view0.getLayoutParams();
        params.height = 504;
        view0.setLayoutParams(params);

        scrollView.setHeader(view0);
        scrollView.setHeaderMaxHeight(getWindowManager().getDefaultDisplay().getHeight());

        //        scrollView.setOverScrollMode(View.OVER_SCROLL_NEVER);
    }
}
